#conding:utf-8
import re
import json
class global_var:
    #case_id
    ID='0'
    url='1'
    run='2'
    request_way='3'
    header='4'
    case_depend='5'
    data_depend='6'
    field_depend='7'
    data='8'
    expect='9'
    result='10'
    token_result='11'
#获取id
def get_id():
    return global_var.ID
# 获取url
def get_urll():
    return global_var.url
# 获取是否执行
def get_run():
    return global_var.run
# 获取请求方式
def get_run_way():
    return  global_var.request_way
# 获取表头
def get_header():
    return global_var.header
# 获取依赖case
def get_case_depend():
    return global_var.case_depend
# 获取依赖数据
def get_data_depend():
    return global_var.data_depend
# 获取依赖附属数据
def get_field_depend():
    return global_var.field_depend
# 获取请求数据
def get_data():
    return global_var.data
# 获取期望值
def get_expect():
    return global_var.expect
# 获取结果
def get_result():
    return global_var.result
# token的状态
def gat_token():
    return global_var.token_result
# 获取token的结果
def get_header_value(token=None):
    #判断如果没有token的返回没带表头个用户
    if token=="no":
        with open('D:/jiekkou/dataconfig/tets.json') as fp:
        # with open('../dataconfig/tets.json') as fp:
            data = json.load(fp)
            fp.close()
            return data['nottoken']
    #     否则返回json的带表头的啊
    else:
        with open('D:/jiekkou/dataconfig/tets.json') as fp:
        # with open('../dataconfig/tets.json') as fp:
            data = json.load(fp)
            fp.close()
            return data['token']

def write_header_value():
    with open('login.json') as f:
        data=json.load(f)


# if  __name__=='__main__':
#     oper=global_var()
#     print(get_header_value('token'))
    # print(oper.get_case_line_data("test02"))
    # print(oper.run_dependent("test02"))

    # print(oper.run_dependent("test01"))
    # print(oper.get_token(1,"test01"))
    # print(oper.get_data_for_key(1,"test01"))
